package com.example.neteasecloudmusic.help;

import java.util.Formatter;
import java.util.Locale;

public class TimeUtil {
    private StringBuilder mFormatBuilder;
    private Formatter mFormatter;

    public TimeUtil() {
        mFormatBuilder = new StringBuilder();
        mFormatter = new Formatter(mFormatBuilder, Locale.getDefault());
    }

    public String stringForTime (int times) {
        int totalSeconds = times / 1000;
        int seconds = totalSeconds % 60;
        int minutes = (totalSeconds / 60) % 60;
        mFormatBuilder.setLength(0);
        return mFormatter.format("%02d:%02d", minutes, seconds).toString();
    }

}
